# add 3-4-13 CRM 发布到ROOT中 
war_t=$1
war_name=$1_tomcat7
echo "publish $war_name"
war_path=home/work/server/$war_name
# stop tomcat
sh /$war_path/bin/shutdown.sh 
	# test stop
	echo "-----stop tomcat-----"
	ps aux|grep tomcat
# copy new & tar
unzip -f /opt/test_ftp/$war_t* -d /$war_path/webapps/ROOT/  >/dev/null 2>&1 &
wait
	
# change config
pe_t=$war_t"-pe"
\cp -rf /$war_path/webapps/$pe_t/*.* /$war_path/webapps/ROOT/WEB-INF/classes/
	#test change config
	echo "------------------config------------------------------------"
	cat /$war_path/webapps/ROOT/WEB-INF/classes/jdbc.properties |grep url   
	echo "------------------------------------------------------------"
# start tomcat
sh /$war_path/bin/startup.sh
	# test new
	echo "------start tomcat-------"
	ps aux|grep tomcat
# del war
rm -rf /opt/test_ftp/$war_t*
